package datas.datasInterior
{
	import events.MonsterInfoEvent;
	
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	
	import interfaces.ILoader;
	
	import uilts.LoadXML;

	//怪物数据加载的选择器
	public class Enemy extends EventDispatcher implements ILoader
	{
		private var urlXML:String;
		private var value:FixedRoute = FixedRoute.getInstance();
		public function Enemy(pass:String)
		{
			switch(pass){
				case "one":
					urlXML = value.LEVEL_1_ENEMY;
					break;
				case "two":
					urlXML = value.LEVEL_2_ENEMY;
					break;
				case "three":
					urlXML = value.LEVEL_3_ENEMY;
					break;
				case "four":
					urlXML = value.LEVEL_4_ENEMY;
					break;
				case "five":
					urlXML = value.LEVEL_5_ENEMY;
					break;
				case "six":
					urlXML = value.LEVEL_6_ENEMY;
					break;
				case "seven":
					urlXML = value.LEVEL_7_ENEMY;
					break;
				case "eight":
					urlXML = value.LEVEL_8_ENEMY;
					break;
				case "nine":
					urlXML = value.LEVEL_9_ENEMY;
					break;
				case "ten":
					urlXML = value.LEVEL_10_ENEMY;
					break;
				case "eleven":
					urlXML = value.LEVEL_11_ENEMY;
					break;
				case "twelve":
					urlXML = value.LEVEL_12_ENEMY;
					break;
			}
			var _urlXML:String = urlXML;
			select(_urlXML);
		}
		
		private function select(_urlXML:String):void
		{
			var loadXML:LoadXML = new LoadXML(this,_urlXML);
		}
		
		public function onComplete(event:Event):void
		{
			var xml:XML = new XML(event.target.data);
			this.dispatchEvent(new MonsterInfoEvent(MonsterInfoEvent.MONSTER_NEW,xml));
		}
	}
}